import request from '@/utils/request';

// 查询优惠券信息及规则列表
export function listCoupon(query) {
	return request({
		url: '/mall/coupon/list',
		method: 'post',
		data: query,
	});
}

// 查询优惠券信息及规则详细
export function getCoupon(id) {
	return request({
		url: '/mall/coupon/getInfo',
		method: 'post',
		data: { id: id },
	});
}

// 新增优惠券信息及规则
export function addCoupon(data) {
	return request({
		url: '/mall/coupon/add',
		method: 'post',
		data: data,
	});
}

// 编辑优惠券信息及规则
export function updateCoupon(data) {
	return request({
		url: '/mall/coupon/edit',
		method: 'post',
		data: data,
	});
}

// 删除优惠券信息及规则
export function delCoupon(id) {
	return request({
		url: '/mall/coupon/remove',
		method: 'post',
		data: { id: id },
	});
}

// 导出优惠券信息及规则
export function exportCoupon(query) {
	return request({
		url: '/mall/coupon/export',
		method: 'post',
		params: query,
	});
}
